import Vue from 'vue';
import Vuex from 'vuex';
import getters from "./getters";
import {Socket} from "../api/Socket";
Vue.use(Vuex)

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        socket: null,
    },
    modules:{

    },
    getters,
    mutations: {
        SET_SOCKET(state, socket){
            state.socket=socket;
        }
    },
    actions: {
        SET_SOCKET({commit}, socket) {
            console.log("设置成功")
            commit('SET_SOCKET', socket)
        },
    }
})

